<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Crawler: Source/Crawler/Application.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Crawler
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_application_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Application.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_application_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_linker_8hpp.html">Crawler/Linker.hpp</a>&gt;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_website_manager_8hpp.html">Crawler/WebsiteManager.hpp</a>&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_worker_manager_8hpp.html">Crawler/WorkerManager.hpp</a>&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;SFML/Network.hpp&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;pugixml.hpp&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="namespace_crawler.html">   11</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_crawler.html">Crawler</a></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;{</div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="class_crawler_1_1_application.html">   13</a></span>&#160;    <span class="keyword">class </span><a class="code" href="_linker_8hpp.html#a6d4e3fff6f0294594417d2aa3530fb57">CRAWLER_API</a> <a class="code" href="class_crawler_1_1_application.html">Application</a></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    {</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;        <span class="keyword">public</span> :</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;            <a class="code" href="class_crawler_1_1_application.html">Application</a> ( ) ;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;            </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;            <span class="keyword">virtual</span> ~<a class="code" href="class_crawler_1_1_application.html">Application</a> ( ) = default ;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;            </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;            <a class="code" href="class_crawler_1_1_application.html">Application</a> ( <span class="keyword">const</span> <a class="code" href="class_crawler_1_1_application.html">Application</a> &amp; application ) = delete ;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;            </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;            <a class="code" href="class_crawler_1_1_application.html">Application</a> ( <a class="code" href="class_crawler_1_1_application.html">Application</a> &amp;&amp; application ) = delete ;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;            </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;            <a class="code" href="class_crawler_1_1_application.html">Application</a> &amp; operator = ( <span class="keyword">const</span> <a class="code" href="class_crawler_1_1_application.html">Application</a> &amp; application ) = delete ;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;            <a class="code" href="class_crawler_1_1_application.html">Application</a> &amp; operator = ( <a class="code" href="class_crawler_1_1_application.html">Application</a> &amp;&amp; application ) = delete ;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            </div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            <span class="keywordtype">void</span> setRunning ( <span class="keywordtype">bool</span> running ) ;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            <span class="keywordtype">bool</span> isRunning ( ) <span class="keyword">const</span> ;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            <a class="code" href="class_crawler_1_1_website_manager.html">Crawler::WebsiteManager</a> &amp; getWebsiteManager ( ) ;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <span class="keyword">const</span> <a class="code" href="class_crawler_1_1_website_manager.html">Crawler::WebsiteManager</a> &amp; getWebsiteManager ( ) <span class="keyword">const</span> ;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <a class="code" href="class_crawler_1_1_worker_manager.html">Crawler::WorkerManager</a> &amp; getWorkerManager ( ) ;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            </div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            <span class="keyword">const</span> <a class="code" href="class_crawler_1_1_worker_manager.html">Crawler::WorkerManager</a> &amp; getWorkerManager ( ) <span class="keyword">const</span> ;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            <span class="keywordtype">int</span> main ( <span class="keyword">const</span> std::vector &lt;std::string&gt; &amp; arguments ) ;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;            </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onStartup ( ) ;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            </div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> onMain ( ) ;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> onShutdown ( ) ;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> onSpawnWorker ( <a class="code" href="class_crawler_1_1_worker.html">Crawler::Worker</a> &amp; worker ) ;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> onDespawnWorker ( <a class="code" href="class_crawler_1_1_worker.html">Crawler::Worker</a> &amp; worker ) ;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;            </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> onUnsupportedProtocol ( <a class="code" href="class_crawler_1_1_worker.html">Crawler::Worker</a> &amp; worker , <a class="code" href="class_crawler_1_1_website.html">Crawler::Website</a> &amp; website ) ;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onRequest ( <a class="code" href="class_crawler_1_1_worker.html">Crawler::Worker</a> &amp; worker , <a class="code" href="class_crawler_1_1_website.html">Crawler::Website</a> &amp; website , <a class="code" href="class_crawler_1_1_link.html">Crawler::Link</a> &amp; link , sf::Http &amp; client , sf::Http::Request &amp; request ) ;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onResponse ( <a class="code" href="class_crawler_1_1_worker.html">Crawler::Worker</a> &amp; worker , <a class="code" href="class_crawler_1_1_website.html">Crawler::Website</a> &amp; website , <a class="code" href="class_crawler_1_1_link.html">Crawler::Link</a> &amp; link , sf::Http &amp; client , sf::Http::Response &amp; response ) ;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onParsing ( <a class="code" href="class_crawler_1_1_worker.html">Crawler::Worker</a> &amp; worker , <a class="code" href="class_crawler_1_1_website.html">Crawler::Website</a> &amp; website , <a class="code" href="class_crawler_1_1_link.html">Crawler::Link</a> &amp; link , pugi::xml_document &amp; document ) ;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;            </div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onReportLink ( <span class="keyword">const</span> std::string &amp; <span class="keywordtype">string</span> ) ;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onAddWebsite ( <a class="code" href="class_crawler_1_1_website.html">Crawler::Website</a> &amp; website ) ;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">bool</span> onAddLink ( <a class="code" href="class_crawler_1_1_website.html">Crawler::Website</a> &amp; website , <a class="code" href="class_crawler_1_1_link.html">Crawler::Link</a> &amp; link ) ;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;            </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> onVisitedWebsites ( ) ;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;        <span class="keyword">protected</span> :</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            <span class="keyword">const</span> std::vector &lt;std::string&gt; &amp; getArguments ( ) <span class="keyword">const</span> ;</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            </div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <span class="keyword">private</span> :</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            <span class="keywordtype">bool</span> running = true ;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            std::vector &lt;std::string&gt; arguments ;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            <a class="code" href="class_crawler_1_1_website_manager.html">Crawler::WebsiteManager</a> websiteManager ;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            <a class="code" href="class_crawler_1_1_worker_manager.html">Crawler::WorkerManager</a> workerManager ;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    } ;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;}</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="_application_8hpp.html#a3f2b4a4f0ec6e7ef34462a2877eb74b9">  150</a></span>&#160;<span class="preprocessor">#define CRAWLER_APPLICATION(x) int main ( int argc , char ** argv ) \</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">{ \</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="preprocessor">    std::vector &lt;std::string&gt; arguments ; \</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="preprocessor">    arguments.reserve ( argc ) ; \</span></div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor"> \</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="preprocessor">    for ( int i = 0 ; i &lt; argc ; ++i ) \</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="preprocessor">        arguments.push_back ( argv [ i ] ) ; \</span></div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="preprocessor"> \</span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="preprocessor">    x instance ; \</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="preprocessor">    return instance.main ( arguments ) ; \</span></div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;<span class="preprocessor">}</span></div>
<div class="ttc" id="_website_manager_8hpp_html"><div class="ttname"><a href="_website_manager_8hpp.html">WebsiteManager.hpp</a></div></div>
<div class="ttc" id="_worker_manager_8hpp_html"><div class="ttname"><a href="_worker_manager_8hpp.html">WorkerManager.hpp</a></div></div>
<div class="ttc" id="class_crawler_1_1_website_html"><div class="ttname"><a href="class_crawler_1_1_website.html">Crawler::Website</a></div><div class="ttdef"><b>Definition:</b> <a href="_website_8hpp_source.html#l00014">Website.hpp:14</a></div></div>
<div class="ttc" id="class_crawler_1_1_worker_manager_html"><div class="ttname"><a href="class_crawler_1_1_worker_manager.html">Crawler::WorkerManager</a></div><div class="ttdef"><b>Definition:</b> <a href="_worker_manager_8hpp_source.html#l00013">WorkerManager.hpp:13</a></div></div>
<div class="ttc" id="namespace_crawler_html"><div class="ttname"><a href="namespace_crawler.html">Crawler</a></div><div class="ttdef"><b>Definition:</b> <a href="_application_8hpp_source.html#l00011">Application.hpp:11</a></div></div>
<div class="ttc" id="class_crawler_1_1_website_manager_html"><div class="ttname"><a href="class_crawler_1_1_website_manager.html">Crawler::WebsiteManager</a></div><div class="ttdef"><b>Definition:</b> <a href="_website_manager_8hpp_source.html#l00012">WebsiteManager.hpp:12</a></div></div>
<div class="ttc" id="class_crawler_1_1_link_html"><div class="ttname"><a href="class_crawler_1_1_link.html">Crawler::Link</a></div><div class="ttdoc">Utility class which represents a link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8hpp_source.html#l00012">Link.hpp:12</a></div></div>
<div class="ttc" id="_linker_8hpp_html"><div class="ttname"><a href="_linker_8hpp.html">Linker.hpp</a></div></div>
<div class="ttc" id="_linker_8hpp_html_a6d4e3fff6f0294594417d2aa3530fb57"><div class="ttname"><a href="_linker_8hpp.html#a6d4e3fff6f0294594417d2aa3530fb57">CRAWLER_API</a></div><div class="ttdeci">#define CRAWLER_API</div><div class="ttdef"><b>Definition:</b> <a href="_linker_8hpp_source.html#l00016">Linker.hpp:16</a></div></div>
<div class="ttc" id="class_crawler_1_1_application_html"><div class="ttname"><a href="class_crawler_1_1_application.html">Crawler::Application</a></div><div class="ttdef"><b>Definition:</b> <a href="_application_8hpp_source.html#l00013">Application.hpp:13</a></div></div>
<div class="ttc" id="class_crawler_1_1_worker_html"><div class="ttname"><a href="class_crawler_1_1_worker.html">Crawler::Worker</a></div><div class="ttdef"><b>Definition:</b> <a href="_worker_8hpp_source.html#l00019">Worker.hpp:19</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_74389ed8173ad57b461b9d623a1f3867.html">Source</a></li><li class="navelem"><a class="el" href="dir_07db96ce4b3001379d5b50a5cb9d08c0.html">Crawler</a></li><li class="navelem"><a class="el" href="_application_8hpp.html">Application.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
